home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / PERFDISP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  1.0 KB  |  59 lines

  1. /* perfdisp.c - measures the performance of disp_page */
  2. #include "stdio.h"
  3.  
  4. char filename[81] ;
  5. char s[2500] ;
  6. extern int row , col ;
  7. long filesize ;
  8. long top_of_page ;
  9. int ix ;
  10.  
  11. main()
  12.   {
  13.      int j , ll ;
  14.      char c ;
  15.  
  16.      /* initialize filename , top_of_page and filesize */
  17.      strcpy(filename,"< file name >") ;
  18.      top_of_page = 3000 ;
  19.      filesize = 123456789 ;
  20.  
  21.      /* build list of chars to be displayed */
  22.      printf("\n line length:") ;
  23.      scanf("%d",&ll) ;
  24.      for( j=0 ; j < ll ; j = j+1 )
  25.     { s[j] = ' '+j ; }
  26.      s[ll] = '\0' ;
  27.  
  28.      /* set up a standing start */
  29.      printf("\n press enter to start") ;
  30.      scanf("%c%c",&c,&c) ;
  31.  
  32.      /* display the page 10 times for accuracy */
  33.      for(j=1 ; j <= 10 ; j = j+1 )
  34.     { display_page() ;  }
  35.  
  36.      printf("\n ** thru **") ;
  37.   }
  38.  
  39.   int get_next_char()
  40.   {
  41.      if( s[ix] == '\0' )
  42.     { ix = 0 ;
  43.        return('\0') ;
  44.     }
  45.      else
  46.     { ix = ix + 1 ;
  47.        return( s[ix-1] ) ;
  48.     }
  49.   }
  50.  
  51.   int move_to(pos)
  52.   long pos ;
  53.   {
  54.      ix = 0 ;
  55.   }
  56.  
  57.  
  58.  
  59.